<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	    <script>
	    	var num1=parseInt(prompt("请您输入第一个数"));
	    	var num2=parseInt(prompt("请您输入第二个数"));
	    	var num3=(prompt("请您输入运算符:+ - * /"));
	    	
	    	var opt = 1;
	    	if (num3 == "+"){
	    		opt = 1;
	    	}else if(num3 == "-"){
	    		opt = 2;
	    	}else if(num3 == "*"){
	    		opt = 3;
	    	}else if(num3 == "/"){
	    		opt = 4;
	    	}else {
	    		alert("请输入加减乘除:+ - * /");
	    		num3=(prompt("请您输入运算符:+ - * /"));
	    	}
	    	//if(num3=="+"){
	    	//	alert(num1+num2);
	    	//}else if(num3=="-"){
	    	//	alert(num1-num2);
	    	//}else if(num3=="*"){
	    	//	alert(num1*num2);
	    	//}else if(num3=="/"){
	    	//	alert(num1/num2);
	    	//}else{
	    	//	alert("错误");
	    	//}
	    switch(opt){
	    	case 1:
	    	alert(num1+num2);
	    	break;
	    	case 2:
	    	alert(num1-num2);
	    	break;
	    	case 3:
	    	alert(num1*num2);
	    	break;
	    	case 4:
	    	alert(num1/num2);
	    	break;
	    	default:
	    	alert("错误！");
	    }
	    </script>
	</body>
</html>
